// 基于jquery扩展工具方法
(function ($) {
    $.extend({
        /**
         * 判断微信移动端/微信小程序端
         * @returns string
         */
        isWechatType: function () {
            var type = '';
            var ua = navigator.userAgent.toLocaleLowerCase();
            if (ua.indexOf('micromessenger') >= 0) {
                if (ua.indexOf('miniprogram') >= 0) {
                    type = 'miniprogram';
                }
                else {
                    type = 'wechat';
                }
            }
            return type;
        },
        /**
         * 判断h5/pc
         * @returns boolean
         */
        isH5: function () {
            var reg = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i;
            if (navigator.userAgent.match(reg)) {
                return true;
            }
            return false;
        }
    });
})(jQuery);